<!-- templates/generate_exam.html -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生成试卷</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <h1>生成试卷</h1>
    <form method="POST" action="{{ url_for('generate_exam') }}">
        <!-- 选择题库 -->
        <h2>选择题库</h2>
        <div class="form-group">
            <label for="xuanze_count">选择题数量:</label>
            <input type="number" id="xuanze_count" name="xuanze_count" required>
        </div>
        <div class="form-group">
            <input type="checkbox" id="xuanze_randomize" name="xuanze_randomize">
            <label for="xuanze_randomize">随机抽题</label>
        </div>
        <div class="form-group">
            <label for="xuanze_questions">选择题目:</label>
            <div>
                {% for question in xuanze_questions %}
                <input type="checkbox" name="xuanze_question_ids" value="{{ question.id }}"> {{ question.question_text }}<br>
                {% endfor %}
            </div>
        </div>

        <!-- 填空题库 -->
        <h2>判断题库</h2>
        <div class="form-group">
            <label for="tiankong_count">判断题数量:</label>
            <input type="number" id="tiankong_count" name="tiankong_count" required>
        </div>
        <div class="form-group">
            <input type="checkbox" id="tiankong_randomize" name="tiankong_randomize">
            <label for="tiankong_randomize">随机抽题</label>
        </div>
        <div class="form-group">
            <label for="tiankong_questions">选择题目:</label>
            <div>
                {% for question in tiankong_questions %}
                <input type="checkbox" name="tiankong_question_ids" value="{{ question.id }}"> {{ question.question_text }}<br>
                {% endfor %}
            </div>
        </div>

        <!-- 主观题库 -->
        <h2>主观题库</h2>
        <div class="form-group">
            <label for="zhuguan_count">主观题数量:</label>
            <input type="number" id="zhuguan_count" name="zhuguan_count" required>
        </div>
        <div class="form-group">
            <input type="checkbox" id="zhuguan_randomize" name="zhuguan_randomize">
            <label for="zhuguan_randomize">随机抽题</label>
        </div>
        <div class="form-group">
            <label for="zhuguan_questions">选择题目:</label>
            <div>
                {% for question in zhuguan_questions %}
                <input type="checkbox" name="zhuguan_question_ids" value="{{ question.id }}"> {{ question.question_text }}<br>
                {% endfor %}
            </div>
        </div>

        <button type="submit">生成试卷</button>
    </form>
</body>
</html>